function test_sort() {
  const arr = [1, 3, 2, 5, 4]

  arr.sort((a, b) => {
    return a - b
  })

  console.log(arr)
}

function test_every() {
  const arr1 = ["a", "b", "", "c", ""]
  console.log(arr1.every(v => v !== ""))

  const arr2 = ["a", "b", "c", "d", "e"]
  console.log(arr2.every(v => v !== ""))

  //空数组的every总返回true
  const arr3: any[] = []
  console.log(arr3.every(v => v !== ""))
  console.log(arr3.every(v => v === ""))
}

function test_some() {
  const arr1 = ["a", "b", "", "c", ""]
  console.log(arr1.some(v => v === ""))

  const arr2 = ["a", "b", "c", "d", "e"]
  console.log(arr2.some(v => v === ""))

  //空数组的every总返回false
  const arr3: any[] = []
  console.log(arr3.some(v => v === ""))
  console.log(arr3.some(v => v !== ""))
}

export function test_array() {
  console.log("===>Test: test_array()")
  // test_every()
  // test_some()
  test_sort()
}
